__author__ = 'tengxue'

# print("hello world")

# 打印到控制台
# print ("你好,python")
#
# x=10
# y=x+1
# print(y)

str="this is a simple demo"
print (str[0])
print (str[1:3])
print (str*2)

list=[123,"avc",str]
#把list的元素复制一边再放入list2中
list2=list*2
print (list)
print (list[0])
print (list[0:2])
print (list2)
print (len(list2))

for var in list2 :
    print("--------------",var)






# 以下代码是错误的
# list3=[]
# list3[0]="abc"
# list3[1]="123"
# list3[4]="567"
# print (list3)

dic={}
dic['name']="dark"
dic['age']='xxx'
print (dic)
print (dic.keys())
#感觉是排过序的 不知道是否是真的
for entity in dic.values():
    print("+++++++++++++",entity)

x="abc"

y="abc"
if (x==y):
    print("x equals y")
else :
    print("x is not equals y")

var = 1
while(var<10):
    var+=1
    print("var is ",var)

print("finally var is ",var)


ages=[20,10,5,30,75,40]
for i in  range(0,len(ages),1):
    print("the i  is ",ages[i])

var=0
for  i in  range(0,10,1):
    var+=1
    print("var incrased",i)
print("the finally var is ",var)

xy=complex(2,2)

print("xy is ",xy)







